package cn.sh.library.mgts.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface IndexService {

	boolean createIndex(String indexName, String mappings, String settings) throws IOException;
//	List<Map<String, String>> searchQuery(SearchMap searchMap);

	boolean delIndex(String indexName);

	boolean putMappings(String indexName, String mappings);

	Map<String, Object> getMappings(String indexName, String property); 

	//索引处理
	boolean createOrUpdateDoc(String indexName, String content, String id, String routing,String refresh);

	boolean createOrUpdateDoc(String indexName, Map<String, Object> content, String id, String routing,String refresh);

	boolean delDoc(String indexName, String id, String routing,String refresh);

	boolean updateDoc(String indexName, String id, String content, String routing,String refresh);

	boolean updateDoc(String indexName, String id, Map<String, Object> content, String routing,String refresh);
	
	Map<String, Object> getDoc(String indexName, String id, String routing);

	List<Map<String, Object>> getData(String indexName,String userJson) throws IOException;
    
	List<Map<String, Object>> getBannedWordsData(String indexName,String json) throws IOException;
	
	boolean getBannedWordsMatching(String indexName,String json) throws IOException;

    Map<String, Object> getAll(String indexName,String routing) throws IOException;
    
    //relation_Mapping索引的处理 重新生成数据id号码随机
    //添加
    boolean createOrUpdateDoc(String indexName, String content, String routing,String refresh);

    boolean delDoc(String indexName,String id, String routing);

	boolean refreshIndices(String... indices);
    
}
